<@master template="master/master-loan"  title="怡亚通380金服__登陆">
    <div class="userBar">
    	<div class="mainbox pr">
        	<div class="uLogin">
            	<div class=""><p class="fr c999 mt10">没有账号？<a href="/uc/register/index">免费注册</a></p><span class="fs24">登录</span></div>
                <div class="inpLi">
                	<ul>
                    	<li class="mt10">
                        	<div class="inpTit fl"><i class="userIco"></i></div>
                        	<input name="account" type="text" class="dlInp" placeholder="手机号">
                        </li>
                        <li class="mt15">
                        	<div class="inpTit fl"><i class="mmIco"></i></div>
                        	<input name="password" type="password" class="dlInp" placeholder="登录密码">
                        </li>
                        <li class="mt15">
                        	<img src="/common/getCaptcha" id="Img" style="width:90px; height:34px;" class='fr yzmImg yamIco' style=" width:1.3rem;">
                        	<div class="inpTit fl"><i class="yzmIco"></i></div>
                        	<input name="erifyCode" type="text" class="dlInp" style="width:130px" placeholder="验证码">
                        </li>
                    </ul>
                    <a id="submitBtn" href="javascript:void(0);" class="ldBtn mt20">登 录</a>
                </div>
                <div class="mt10" style="text-align:right">
                	<a href="/uc/forgetPassword/index" class="tar c666" >忘记密码？</a>
                </div>
            </div>
        </div>
    </div>
    <@include file="/common/footer"/>
	<@js>  
	  $(document).ready(function(){
		  $("#Img").bind("click",function(){
		  	 var img = document.getElementById("Img");  
	         img.src = "/common/getCaptcha?rnd=" + Math.random();  
		  });
		  $("#submitBtn").bind("click",function(){
				var _this = $(this);
	    		var mobile = $("input[name='account']").val();
	    		var mobileCheck = $.fn.validate.mobile(mobile);
	    		if(!mobileCheck.isSuccess){
	    			$.actionDialog({message : mobileCheck.errorMsg});
	    			return false;
	    		}
	    		var password = $("input[name='password']").val();
	    		var passwordCheck = $.fn.validate.password(password);
	    		if(!passwordCheck.isSuccess){
	    			$.actionDialog({message : passwordCheck.errorMsg});
	    			return false;
	    		}
	    		var erifyCode = $("input[name='erifyCode']").val();
	    		if(!erifyCode){
	    			$.actionDialog({message : '请输入图片验证码'});
	    			return false;
	    		}
	    		$.getJSON("/common/checkCaptcha",{captcha:erifyCode},function(result){
	    			if(result.data == true){
	   					$.ajax({
			    			url:"/uc/rest/login",
			    			dataType:"json",
			    			data:{account:mobile,password:password},
			    			success:function(msgResult){
			    				if(msgResult.data.success == true){
			    					window.location.href="/loanApply/index";
			    				}else{
			    					$.actionDialog({message : msgResult.data.errMsg});
			    				}
			    			}
			    		});
	   					
	   				}else{
	   					$.actionDialog({message : '图片验证码错误'});
	   				}
	    		});
			
			});
				
		})
	</@js>
	<@jsRender/>  
</@master>